//
//  Music_list_tv_cell.m
//  ainkjj
//
//  Created by zhiyiLiu on 2020/3/19.
//  Copyright © 2020 zhiyiLiu. All rights reserved.
//

#import "Music_list_tv_cell.h"

@implementation Music_list_tv_cell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setEntity:(App_getMusicListMusic_list *)entity{
    _entity = entity;
    
    self.title_lb.text = entity.title;
    self.author_lb.text = entity.author;
    self.index_lb.text = @(entity.index + 1).stringValue;
    if (entity.isSelected) {
        self.index_lb.hidden = YES;
        self.playing_iv.hidden = NO;
        self.title_lb.textColor = themeColor;
        
        NSString *value = self.entity.audio_execute_status;
        if ([value isEqualToString:@"open"]) {
            self.status_btn.selected = YES;
        }else if ([value isEqualToString:@"close"]) {
            self.status_btn.selected = NO;
        }else if ([value isEqualToString:@"pause"]) {
            self.status_btn.selected = NO;
        }else if ([value isEqualToString:@"recover"]) {
            self.status_btn.selected = YES;

        }
        
    }else{
        self.index_lb.hidden = NO;
        self.playing_iv.hidden = YES;
        self.status_btn.selected = NO;
        self.title_lb.textColor = [UIColor darkTextColor];
    }
    
}

@end
